package com.finaOutorderProvider.controller;

import entity.Outorderinfo;
import entity.ResponseMessage;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import service.financial.FinaOutorderService;

import java.util.Map;

/**
 * @author oahner
 * @create 2022-04-19 14:31
 */
@RestController
@CrossOrigin
@RequestMapping("finaOutorder")
public class FinaOutorderProviderController {

    private Logger logger = Logger.getLogger(getClass());

    @Autowired
    private FinaOutorderService service;

    /**
     *
     * @param finaOutorderPage
     * @return
     */
    @RequestMapping("getFinaOutorder")
    public ResponseMessage getFinaOutorder(@RequestBody Map<String,Object> finaOutorderPage){
        logger.info("FinaOutorderProviderController getFinaOutorder params:finaOutorderPage="+finaOutorderPage);
        ResponseMessage msg = service.getFinaOutorder(finaOutorderPage);
        logger.debug("FinaOutorderProviderController getFinaOutorder result:msg="+msg);
        return msg;
    }

    /**
     * 获取门店订单详情
     * @param finaOutorderinfo
     * @return
     */
    @RequestMapping("getFinaOutorderInfo")
    public ResponseMessage getFinaOutorderInfo(@RequestBody Outorderinfo finaOutorderinfo){
        logger.info("FinaOutorderProviderController getFinaOutorder params:finaOutorderinfo="+finaOutorderinfo);
        ResponseMessage msg = service.getFinaOutorderInfo(finaOutorderinfo);
        logger.debug("FinaOutorderProviderController getFinaOutorder result:msg="+msg);
        return msg;
    }


}
